package PTA_JAVA.JavaA.Javademo15;

import java.util.Random;
import java.util.Scanner;

/**
 * @author win10
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long seed = sc.nextLong();
        Random r = new Random(seed);
        int n = sc.nextInt();
        double count=0;
        for (int i = 0; i <n; i++) {
            double x = r.nextDouble()*-2+1;
            double y = r.nextDouble()*-2+1;
            if(Math.pow(x,2)+Math.pow(y,2)<=1){
                count++;
            }
        }
        // 4*(落入圆中的点/总正方形内点的个数)
        System.out.println(4*(count/n));
    }
}
